3.14 \(\int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx\)

Optimal. Leaf size=97 \[ \frac{3 a^3 c^2 \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac{c^2 \tan ^3(e+f x) \left (3 a^3 \sec (e+f x)+4 a^3\right )}{12 f}-\frac{c^2 \tan (e+f x) \left (3 a^3 \sec (e+f x)+8 a^3\right )}{8 f}+a^3 c^2 x \]

[Out]

a^3*c^2*x + (3*a^3*c^2*ArcTanh[Sin[e + f*x]])/(8*f) - (c^2*(8*a^3 + 3*a^3*Sec[e + f*x])*Tan[e + f*x])/(8*f) +
(c^2*(4*a^3 + 3*a^3*Sec[e + f*x])*Tan[e + f*x]^3)/(12*f)

________________________________________________________________________________________

Rubi [A]  time = 0.114357, antiderivative size = 97, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {3904, 3881, 3770} \[ \frac{3 a^3 c^2 \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac{c^2 \tan ^3(e+f x) \left (3 a^3 \sec (e+f x)+4 a^3\right )}{12 f}-\frac{c^2 \tan (e+f x) \left (3 a^3 \sec (e+f x)+8 a^3\right )}{8 f}+a^3 c^2 x \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Sec[e + f*x])^3*(c - c*Sec[e + f*x])^2,x]

[Out]

a^3*c^2*x + (3*a^3*c^2*ArcTanh[Sin[e + f*x]])/(8*f) - (c^2*(8*a^3 + 3*a^3*Sec[e + f*x])*Tan[e + f*x])/(8*f) +
(c^2*(4*a^3 + 3*a^3*Sec[e + f*x])*Tan[e + f*x]^3)/(12*f)

Rule 3904

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[(-(a*c))^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rule 3881

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> -Simp[(e*(e*Cot[
c + d*x])^(m - 1)*(a*m + b*(m - 1)*Csc[c + d*x]))/(d*m*(m - 1)), x] - Dist[e^2/m, Int[(e*Cot[c + d*x])^(m - 2)
*(a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m, 1]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx &=\left (a^2 c^2\right ) \int (a+a \sec (e+f x)) \tan ^4(e+f x) \, dx\\ &=\frac{c^2 \left (4 a^3+3 a^3 \sec (e+f x)\right ) \tan ^3(e+f x)}{12 f}-\frac{1}{4} \left (a^2 c^2\right ) \int (4 a+3 a \sec (e+f x)) \tan ^2(e+f x) \, dx\\ &=-\frac{c^2 \left (8 a^3+3 a^3 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{c^2 \left (4 a^3+3 a^3 \sec (e+f x)\right ) \tan ^3(e+f x)}{12 f}+\frac{1}{8} \left (a^2 c^2\right ) \int (8 a+3 a \sec (e+f x)) \, dx\\ &=a^3 c^2 x-\frac{c^2 \left (8 a^3+3 a^3 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{c^2 \left (4 a^3+3 a^3 \sec (e+f x)\right ) \tan ^3(e+f x)}{12 f}+\frac{1}{8} \left (3 a^3 c^2\right ) \int \sec (e+f x) \, dx\\ &=a^3 c^2 x+\frac{3 a^3 c^2 \tanh ^{-1}(\sin (e+f x))}{8 f}-\frac{c^2 \left (8 a^3+3 a^3 \sec (e+f x)\right ) \tan (e+f x)}{8 f}+\frac{c^2 \left (4 a^3+3 a^3 \sec (e+f x)\right ) \tan ^3(e+f x)}{12 f}\\ \end{align*}

Mathematica [A]  time = 0.791387, size = 122, normalized size = 1.26 \[ \frac{a^3 c^2 \sec ^4(e+f x) \left (18 \sin (e+f x)-32 \sin (2 (e+f x))-30 \sin (3 (e+f x))-32 \sin (4 (e+f x))+96 (e+f x) \cos (2 (e+f x))+24 e \cos (4 (e+f x))+24 f x \cos (4 (e+f x))+72 \cos ^4(e+f x) \tanh ^{-1}(\sin (e+f x))+72 e+72 f x\right )}{192 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sec[e + f*x])^3*(c - c*Sec[e + f*x])^2,x]

[Out]

(a^3*c^2*Sec[e + f*x]^4*(72*e + 72*f*x + 72*ArcTanh[Sin[e + f*x]]*Cos[e + f*x]^4 + 96*(e + f*x)*Cos[2*(e + f*x
)] + 24*e*Cos[4*(e + f*x)] + 24*f*x*Cos[4*(e + f*x)] + 18*Sin[e + f*x] - 32*Sin[2*(e + f*x)] - 30*Sin[3*(e + f
*x)] - 32*Sin[4*(e + f*x)]))/(192*f)

________________________________________________________________________________________

Maple [A]  time = 0.025, size = 136, normalized size = 1.4 \begin{align*} -{\frac{4\,{c}^{2}{a}^{3}\tan \left ( fx+e \right ) }{3\,f}}+{\frac{3\,{c}^{2}{a}^{3}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{8\,f}}+{a}^{3}{c}^{2}x+{\frac{{a}^{3}{c}^{2}e}{f}}-{\frac{5\,{c}^{2}{a}^{3}\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{8\,f}}+{\frac{{c}^{2}{a}^{3}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{3\,f}}+{\frac{{c}^{2}{a}^{3}\tan \left ( fx+e \right ) \left ( \sec \left ( fx+e \right ) \right ) ^{3}}{4\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x)

[Out]

-4/3/f*c^2*a^3*tan(f*x+e)+3/8/f*c^2*a^3*ln(sec(f*x+e)+tan(f*x+e))+a^3*c^2*x+1/f*a^3*c^2*e-5/8/f*c^2*a^3*sec(f*
x+e)*tan(f*x+e)+1/3/f*c^2*a^3*tan(f*x+e)*sec(f*x+e)^2+1/4/f*c^2*a^3*tan(f*x+e)*sec(f*x+e)^3

________________________________________________________________________________________

Maxima [B]  time = 1.01915, size = 274, normalized size = 2.82 \begin{align*} \frac{16 \,{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c^{2} + 48 \,{\left (f x + e\right )} a^{3} c^{2} - 3 \, a^{3} c^{2}{\left (\frac{2 \,{\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 24 \, a^{3} c^{2}{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 48 \, a^{3} c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) - 96 \, a^{3} c^{2} \tan \left (f x + e\right )}{48 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

1/48*(16*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^3*c^2 + 48*(f*x + e)*a^3*c^2 - 3*a^3*c^2*(2*(3*sin(f*x + e)^3 - 5
*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1) - 3*log(sin(f*x + e) + 1) + 3*log(sin(f*x + e) - 1)) +
24*a^3*c^2*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) + 48*a^3*c^2*
log(sec(f*x + e) + tan(f*x + e)) - 96*a^3*c^2*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.14746, size = 359, normalized size = 3.7 \begin{align*} \frac{48 \, a^{3} c^{2} f x \cos \left (f x + e\right )^{4} + 9 \, a^{3} c^{2} \cos \left (f x + e\right )^{4} \log \left (\sin \left (f x + e\right ) + 1\right ) - 9 \, a^{3} c^{2} \cos \left (f x + e\right )^{4} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 2 \,{\left (32 \, a^{3} c^{2} \cos \left (f x + e\right )^{3} + 15 \, a^{3} c^{2} \cos \left (f x + e\right )^{2} - 8 \, a^{3} c^{2} \cos \left (f x + e\right ) - 6 \, a^{3} c^{2}\right )} \sin \left (f x + e\right )}{48 \, f \cos \left (f x + e\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

1/48*(48*a^3*c^2*f*x*cos(f*x + e)^4 + 9*a^3*c^2*cos(f*x + e)^4*log(sin(f*x + e) + 1) - 9*a^3*c^2*cos(f*x + e)^
4*log(-sin(f*x + e) + 1) - 2*(32*a^3*c^2*cos(f*x + e)^3 + 15*a^3*c^2*cos(f*x + e)^2 - 8*a^3*c^2*cos(f*x + e) -
 6*a^3*c^2)*sin(f*x + e))/(f*cos(f*x + e)^4)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} a^{3} c^{2} \left (\int 1\, dx + \int \sec{\left (e + f x \right )}\, dx + \int - 2 \sec ^{2}{\left (e + f x \right )}\, dx + \int - 2 \sec ^{3}{\left (e + f x \right )}\, dx + \int \sec ^{4}{\left (e + f x \right )}\, dx + \int \sec ^{5}{\left (e + f x \right )}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))**3*(c-c*sec(f*x+e))**2,x)

[Out]

a**3*c**2*(Integral(1, x) + Integral(sec(e + f*x), x) + Integral(-2*sec(e + f*x)**2, x) + Integral(-2*sec(e +
f*x)**3, x) + Integral(sec(e + f*x)**4, x) + Integral(sec(e + f*x)**5, x))

________________________________________________________________________________________

Giac [A]  time = 1.34503, size = 217, normalized size = 2.24 \begin{align*} \frac{24 \,{\left (f x + e\right )} a^{3} c^{2} + 9 \, a^{3} c^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right ) - 9 \, a^{3} c^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right ) + \frac{2 \,{\left (15 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{7} - 71 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 137 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 33 \, a^{3} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 1\right )}^{4}}}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="giac")

[Out]

1/24*(24*(f*x + e)*a^3*c^2 + 9*a^3*c^2*log(abs(tan(1/2*f*x + 1/2*e) + 1)) - 9*a^3*c^2*log(abs(tan(1/2*f*x + 1/
2*e) - 1)) + 2*(15*a^3*c^2*tan(1/2*f*x + 1/2*e)^7 - 71*a^3*c^2*tan(1/2*f*x + 1/2*e)^5 + 137*a^3*c^2*tan(1/2*f*
x + 1/2*e)^3 - 33*a^3*c^2*tan(1/2*f*x + 1/2*e))/(tan(1/2*f*x + 1/2*e)^2 - 1)^4)/f